package com.itsm.example.audit.pojo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itsm.example.statemachine.bo.ItsmContext;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author benym
 * @date 2023/7/12 16:23
 */
@Data
@TableName("audit")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AuditDO {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField(value = "audit_state")
    private Integer auditState;

    @TableField(value = "inst_id")
    private String instId;


    public  ItsmContext toContext() {
        return ItsmContext.builder()
                .id(this.id)
                .instId(this.instId)
                .build();
    }

}
